﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Press.MVC.Data;
using Press.MVC.Services;
using System.Reflection;

namespace Press.MVC.Tests
{
    [TestClass]
    public class BlogTests
    {
        BlogService blogService;
        
        [TestInitialize]
        public void Setup()
        {
            IBlogRepository ibrep = new TestBlogRepository();
            blogService = new BlogService(ibrep);
        }

        [TestMethod]
        public void BlogRepository_Repository_Blogs_IsNotNull()
        {
            IBlogRepository ibrep = new TestBlogRepository();
            Assert.IsNotNull(ibrep.GetBlogs());
        }

        [TestMethod]
        public void BlogService_Can_Get_Blogs_From_Service()
        {
            IList<Blog> blogs = blogService.GetBlogs();
            Assert.IsTrue(blogs.Count > 0);
        }
    }
}
